//引入模板的全局的样式
import '@/styles/index.scss'

import { createApp } from 'vue'
import App from '@/App.vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import zhCn from 'element-plus/es/locale/lang/zh-cn'

// 暗黑模式
import 'element-plus/theme-chalk/dark/css-vars.css'

// SVG插件配置
import 'virtual:svg-icons-register'

//引入路由
import router from './router'

// 引入仓库
import pinia from './store'

const app = createApp(App)

app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(ElementPlus)

//注册模板路由
app.use(router)

//引入路由鉴权文件
import './permission'

// 方式一单独注册图标组件
// import SvgIcon from '@/components/SvgIcon/index.vue'
// app.component('SvgIcon', SvgIcon)

// 方法二一次性注册所有的全局组件
import allGlobalComponents from '@/components/index'
app.use(allGlobalComponents)

// 引入自定义指令文件
import { isHasButton } from '@/directive/has'
isHasButton(app)

app.mount('#app')
